package main

import (
	"fmt"
	"time"
)

var tb = 0
func say(ch chan<- int) {
	for{
		ch <- tb 
		tb++
		time.Sleep(1000* time.Millisecond)
	}
	
}

func main() {

	ch := make(chan int)
	for i := 0; i < 10000; i++{
		go say(ch)
	}
	
	for{
		fmt.Println(<-ch) // 从通道 ch 接收
		//time.Sleep(100 * time.Millisecond)
	}
}